export type TaskStatusItem = {
  status: string
  name: string
  title: string
  isError: boolean
}

export const statusMap: any = {
  未开始: 'not_start',
  进行中: 'underway',
  已结束: 'end'
}

export const taskStatusList: TaskStatusItem[] = [
  {
    status: '评测中',
    name: '评测中..',
    title: '评测中',
    isError: false
  },
  {
    status: '评测失败',
    name: '评测失败',
    title: '评测失败',
    isError: true
  },
  {
    status: '评测成功',
    name: '评测成功',
    title: '评测成功',
    isError: false
  },
  {
    status: '评测超时',
    name: '评测超时',
    title: '评测超时',
    isError: true
  }
]

export const getTaskStatusItem = (status: string): TaskStatusItem => {
  return taskStatusList.find(item => item.status === status)!
}
